#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<stack>
using namespace std;
string s;
string s1;
stack<int> sta;

int main(){
	cin>>s;
	int i=0;
	s1="";
	int ans=0;
	while(s[i]!='@'){
		if(s[i]>='0'&&s[i]<='9'){
			s1+=s[i];
		}
		else if(s[i]=='.'){
			sta.push(std::stoi(s1));
			s1="";
		}
		else{
			int x1=sta.top();
			sta.pop();
			int x2=sta.top();
			sta.pop();
			if(s[i]=='+') ans+=x2+x1;
			else if(s[i]=='-') ans+=x2-x1;
			else if(s[i]=='*') ans+=x2*x1;
			else if(s[i]=='/') ans+=x2/x1;
		};
		++i;
	};
	cout<<ans;
	return 0;
}
